package com.example.shopping2.a_c_fragment.classa.adapter

import android.graphics.Color
import android.graphics.drawable.ColorDrawable
import android.text.style.BackgroundColorSpan
import android.widget.TextView
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.example.shopping2.R
import com.example.shopping2.a_c_fragment.classa.entity.Classleft_Entity

class Left_Adapter(list:ArrayList<Classleft_Entity.DataBean>) :BaseQuickAdapter<Classleft_Entity.DataBean,BaseViewHolder>(R.layout.class_left,list) {
    override fun convert(holder: BaseViewHolder, item: Classleft_Entity.DataBean) {
        holder.setText(R.id.class_left_text,item.category_name)
        var view = holder.getView<TextView>(R.id.class_left_text)
        if (item.checked){
            view.setBackgroundResource(R.drawable.time_bg)
        }else{
            view.background = ColorDrawable()
        }
    }
}